/*
 * Created on Dec 21, 2004
 */
package org.vectrics.recruiter.document;

import org.apache.log4j.Logger;
import org.quartz.Job;
import org.quartz.JobExecutionException;
import org.vectrics.batch.VectricsQuartzJob;
import org.vectrics.domain.Domain;
import org.vectrics.hibernate.ApplicationContext;

/**
 * This class adds resumes and other documents that have not yet been indexed to the document index.
 * This index makes key word searches faster for other processes.
 * @author MMoore
 */
public class CandidateDocumentIndexingBatchRun extends VectricsQuartzJob implements Job {
	private transient final Logger log = Logger.getLogger(CandidateDocumentIndexingBatchRun.class);
	
	public CandidateDocumentIndexingBatchRun() {
		super();
	}

	public String getName() {
		return("Resume Expiration and Document Indexing Batch Job");
	}
	
	/**
	 * Do the indexing for all un-indexed documents for the passed data owner.
	 */
	public void doExecute(Domain domain, ApplicationContext arg0) throws JobExecutionException {
		log.debug("doExecute() called");
		CandidateDocumentIndexingBatch runnable = new CandidateDocumentIndexingBatch(domain);
		runnable.run();
	}

}
